package com.abyss.sink;


import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.operators.DataSource;

import java.util.List;

public class SinkTOLocalDemo {
    public static void main(String[] args) throws Exception {
        // 1. Env
        ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

        // 2. Source
        DataSource<Long> source = env.generateSequence(1, 10);

        // 3. sink, 打印到标准数据流中
        source.print();

        // 4. sink, 打印到标准错误流中
        source.printToErr();

        // 5. sink, 采集
        List<Long> collect = source.collect();
        System.out.println(collect);
    }
}